<template>
    <div  v-for="item in titleData" :key="item.id">
        <button>{{ item.id }}</button>
        <h3>{{item.title}}</h3>
        <p>{{ item.content }}</p>
        <template v-for="(items,index) in item.choose" :key="index">
            <input type="radio" name="item.id">
            <label for="">{{items}}</label>
        </template>
    </div>
    
</template>

<script setup>
    import { ref } from 'vue'
    const titleData = ref([
        {id:1,title:"1、请问下列 arr.length 的值是多少：",
            content:"var arr = [];arr[0] = 2;arr[1] = 2;arr[4] = 3;arr[7] = 6;",
            choose:["A.4","B.8","C.报错","D.7"],answer:2
        },
        {id:2,title:"1、请问下列 arr.length 的值是多少：",
            content:"var arr = [];arr[0] = 2;arr[1] = 2;arr[4] = 3;arr[7] = 6;",
            choose:["A.4","B.8","C.报错","D.7"],answer:2
        }
    ]);
   
    
</script>

<style lang="scss" scoped>

</style>